#include <fstream>
#include <iostream>
#include <string>

using namespace std;

int main() {
    int last = 0;

    ifstream in("append.txt", ios::in);
    if (in) {
        int t;
        while (in >> t) {
            last = t;
        }

        in.close();
    }

    ofstream app("append.txt", ios::app);

    app << " " << last+1;

    app.close();

    return 0;
}